home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Copy constructing an already default constructed object
- Date: 26 Jan 1996 20:45:39 GMT
- Organization: self-employed
- Message-ID: <4ebehj$5i7@news.bridge.net>
- References: <4e906b$stk@elaine32.Stanford.EDU> <4eal0n$hgq@dawn.mmm.com> <3108ef14.340699@nntp>
- NNTP-Posting-Host: ppp-mia1-65.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- >> A::operator =(const A& other)
- >> {
- >> b0 = other.b0 ;
- >> b1 = other.b1;
- >> }
-
- >> To me this seems like a major pain in the butt.
-
- That's precisely why the compiler will automatically generate a public
- assignment operator with this behaviour, if you don't bother to write
- one.
-
-
- >> Do you have to overload = for all the contained operators too?
-
- >> All I really want to do is have the copy constructor invoked on the
- >> piece that piece of memory. Why can't this be done?
-
- Brien, I genuinely cannot understand what you are trying to say in these
- two sentences. Sloppy English, like C++, can be a "major pain the the
- butt".
-
- David
-
-
-